<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>简介</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="book.image.html">GD</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="image.setup.html">安装／配置</a></div>
 <div class="up"><a href="book.image.html">GD</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="intro.image" class="preface">
  <h1 class="title">简介</h1>
  <p class="para">
   PHP is not limited to creating just HTML output.  It can also be
   used to create and manipulate image files in a variety of different
   image formats, including <acronym title="Graphic Interchange Format">GIF</acronym>, <acronym title="Portable Network Graphics">PNG</acronym>,
   <acronym title="Joint Photographic Experts Group">JPEG</acronym>, <acronym title="Wireless Bitmap">WBMP</acronym>, and <acronym>XPM</acronym>.
   Even more convenient, PHP can output image streams directly to a browser. You
   will need to compile PHP with the <acronym title="Graphics Draw">GD</acronym> library of image
   functions for this to work. <acronym title="Graphics Draw">GD</acronym> and PHP may also require
   other libraries, depending on which image formats you want to work with.
  </p>
  <p class="para">
   You can use the image functions in PHP to get the size of
   <acronym title="Joint Photographic Experts Group">JPEG</acronym>, <acronym title="Graphic Interchange Format">GIF</acronym>,
   <acronym title="Portable Network Graphics">PNG</acronym>, <acronym title="Shockwave Flash">SWF</acronym>,
   <acronym title="Tagged Image File Format">TIFF</acronym> and <acronym>JPEG2000</acronym> images.
  </p>
  <p class="para">
   With the <a href="ref.exif.html" class="link">exif extension</a>, you are able
   to work with information stored in headers of
   <acronym title="Joint Photographic Experts Group">JPEG</acronym> and <acronym title="Tagged Image File Format">TIFF</acronym> images. This way you can
   read meta data generated by digital cameras. The exif
   functions do not require the <acronym title="Graphics Draw">GD</acronym> library.
  </p>
  
  <p class="para">
   <blockquote class="note"><p><strong class="note">Note</strong>: 
    <span class="simpara">
     Read the requirements section about how to expand image capabilities
     to read, write and modify images. To read meta data of pictures
     taken by digital cameras you need the above mentioned
     <a href="ref.exif.html" class="link">exif extension</a>.
    </span>
   </p></blockquote>
   <blockquote class="note"><p><strong class="note">Note</strong>: 
    <span class="simpara">
      The <span class="function"><a href="function.getimagesize.html" class="function">getimagesize()</a></span> function does not require the GD extension.
    </span>
   </p></blockquote>
  </p>

  <p class="para">
   GD supports a varity of formats, below is a list of formats supported by GD and notes 
   to their availability including read/write support.
  </p>
  <p class="para">
   <table class="doctable table">
    <caption><strong>Formats supported by GD</strong></caption>
    
     <thead>
      <tr>
       <th>Format</th>
       <th>Read support</th>
       <th>Write support</th>
       <th>Notes</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>JPEG</td>
       <td><strong><code>TRUE</code></strong></td>
       <td><strong><code>TRUE</code></strong></td>
       <td>GD 1.8+</td>
      </tr>

      <tr>
       <td>PNG</td>
       <td><strong><code>TRUE</code></strong></td>
       <td><strong><code>TRUE</code></strong></td>
       <td class="empty">&nbsp;</td>
      </tr>

      <tr>
       <td>GIF</td>
       <td><strong><code>TRUE</code></strong></td>
       <td><strong><code>TRUE</code></strong></td>
       <td>Not available between GD 1.6 and GD 2.0.28</td>
      </tr>

      <tr>
       <td>XBM</td>
       <td><strong><code>TRUE</code></strong></td>
       <td><strong><code>TRUE</code></strong></td>
       <td>Read support as of PHP 4.0.1 and write support as of PHP 5.0.0</td>
      </tr>

      <tr>
       <td>XPM</td>
       <td><strong><code>TRUE</code></strong></td>
       <td><strong><code>FALSE</code></strong></td>
       <td>Read support as of PHP 4.0.1, not available on Windows. Requires bundled version of GD</td>
      </tr>

      <tr>
       <td>WBMP</td>
       <td><strong><code>TRUE</code></strong></td>
       <td><strong><code>TRUE</code></strong></td>
       <td>GD 1.8+</td>
      </tr>

      <tr>
       <td>WebP</td>
       <td><strong><code>TRUE</code></strong></td>
       <td><strong><code>TRUE</code></strong></td>
       <td>GD 2.1+, PHP 5.5+</td>
      </tr>

     </tbody>
    
   </table>

  </p>
  <p class="para">
   Despite most formats being available for both reading and writing in the above table, doesn&#039;t 
   mean that PHP was compiled with support for them. To find out which formats that was available 
   to GD during compilation, use the <span class="function"><a href="function.gd-info.html" class="function">gd_info()</a></span> function, for more information 
   about compiling support for one or more formats, see the installation chapter.
  </p>
 </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="book.image.html">GD</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="image.setup.html">安装／配置</a></div>
 <div class="up"><a href="book.image.html">GD</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
